<?php
	require_once './controller/commentController.php';
	require_once ('webView.php');
	$result = getNewestCommentController();
	if(is_array($result)){
		foreach($result as $key => $value) {
			echo "<div class='media newcomment'>";
			echo "<a class='pull-left' href='#'>";
			if ($dataAvatar = @getimagesize($value->user_avatar_zing)) {
				echo"<img class='media-object imgnewfeed' src='".$value->user_avatar_zing."' alt='".$value->user_name."' width='50' height='50'>";
			} else {
				echo"<img class='media-object imgnewfeed' src='".$avatar_default."' alt='".$value->user_name."' width='50' height='50'>";
			}
			echo "</a>";
			echo "<div class='media-body detailcomment'>";
			echo "<h4 class='media-heading'>".$value->user_name." đã bình luận tại <a href='#' style='color: blue;'>".$value->place_name."</a></h4>";
			if($value->stt<5)
				echo $value->detail_comment."</div><hr style='margin-left: 20px; margin-right: 20px;'>";
			else
				echo $value->detail_comment."</div><hr style='margin-left: 0px; margin-right: 0px; border-top: 1px solid #ff0000;'>";
			echo "</div>";
		}
	}
?>